import {
  SUPPLIER_CLASSIFY_OPTIONS,
  SUPPLIER_NATURE_OPTIONS
} from '@sourcing/constants';

export const initFormItemList = (areaList) => {
  return [
    {
      prop: 'supplierCode',
      label: '供应商代码',
      type: 'input'
    },
    {
      prop: 'supplierName',
      label: '供应商名称',
      type: 'input'
    },
    {
      prop: 'supplierManagerAreaId',
      label: '管理区域',
      type: 'select',
      options: areaList
    },
    {
      prop: 'supplierStatus',
      label: '供应商类型',
      type: 'select',
      options: SUPPLIER_CLASSIFY_OPTIONS
    },
    {
      prop: 'supplierNature',
      label: '供应商性质',
      type: 'select',
      options: SUPPLIER_NATURE_OPTIONS
    },
  ]
}
// 列表字段
export const TABLE_COLUMNS = [
  {
    title: '归属中心',
    key: 'belongDepartmentName',
    width: 100
  },
  {
    title: '供应商代码',
    key: 'supplierCode',
    width: 100
  },
  {
    title: '供应商名称',
    key: 'supplierName',
    width: 100
  },
  {
    title: '供应商管理区域',
    key: 'supplierManagerAreaName',
    width: 120
  },
  {
    title: '供应商类型',
    key: 'supplierStatusStr',
    width: 100
  },
  {
    title: '供应商性质',
    key: 'supplierNatureStr',
    width: 100
  },
  {
    title: '可直送金额（万元）',
    key: 'directDeliveryAmount',
    width: 130
  },
  {
    title: '可直送范围',
    key: 'directDeliveryRangeStr',
    width: 100
  },
  {
    title: '供应商到货周期',
    key: 'supplyCycle',
    width: 120
  },
  {
    title: '运费承担方',
    key: 'freightPayerStr',
    width: 100
  },
  {
    title: '费用比例（%）',
    key: 'expenseRatio',
    width: 110
  },
  {
    title: '备注',
    key: 'remark',
  },
  {
    title: '更新人',
    key: 'updateName',
  },
  {
    title: '更新人部门',
    key: 'updateDeptName',
  },
  {
    title: '更新时间',
    key: 'updateTime',
  },
]
export const ERRORS_COLUMN = {
  title: '异常原因',
  key: 'errorMsg',
  fixed: 'left',
  width: '130',
  errorTip: true,
  notShowTip: true,
}
